package com.hgy.hhao.springboot_vue.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * @author HhaoAn
 * @date 2025年03月02日 19:06
 * @description yml自定义配置测试
 */
@Component
// 前缀自动配置
@ConfigurationProperties(prefix = "hhao")
public class YmlTest {
//    @Value("${hhao.user}")
    private String user;
//    @Value("${hhao.password}")
    private String password;
//    @Value("${hhao.arrs}")
    private String[] arrs;

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String[] getArrs() {
        return arrs;
    }

    public void setArrs(String[] arrs) {
        this.arrs = arrs;
    }

    @Override
    public String toString() {
        return "YmlTest{" +
                "user='" + user + '\'' +
                ", password='" + password + '\'' +
                ", arrs=" + Arrays.toString(arrs) +
                '}';
    }
}
